<?php

namespace App\Http\Requests;

use App\Exceptions\exception\ApiExcetion;
use Illuminate\Foundation\Http\FormRequest;

class FollowV2Request extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'customer_id'=>'required',
            'desc'=>'required',
         //   'image'=>'required',
            'follow_status'=>'required'
        ];
    }
    public function  messages()
    {
        return [
            'customer_id.required'=>'请输入客户id',
            'desc.required'=>'请输入备注',
           // 'image.required'=>'请上传图片',
            'follow_status'=>'请输入follow_status',
        ];
    }
    protected function failedValidation(\Illuminate\Contracts\Validation\Validator $validator)
    {

        throw new ApiExcetion($validator->errors()->first());
    }
}
